#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int n, m, k, j,f, count = 0;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> m;
        k = sqrt(m);
        for (j = 2,f=1; j <= k; j++)
        {
            if (m % j == 0)
            {
                f=0;
                break;
                
            }
        }
        count += f;
        
    }

    cout << count << endl;
}